 <?php
  use yii\helpers\Html;
  use yii\helpers\Url;
  use yii\bootstrap\ActiveForm;
  use yii\widgets\LinkPager;

  $this->title = 'completelist';
 ?>
<style>
  ul,li{margin:0;padding:0;list-style: none;}
  .search_box{display:none;}
  .search_box .zhezhao{position:fixed;top:0;left:0;right:0;bottom:0;background:#000;opacity:0.6;}
  .search_box .search_form{position:absolute;top:10%;width:60%;background:#FFF;left:20%;}
  .search_box .search_form .form-group{margin-right: 0;margin-left:0;}
  .searchsex_box{overflow:hidden;}
  .searchsex_box>span{float:left;margin-top:10px;font-weight:700;}
  .searchsex_box .radio{float:left;margin-left:50px;}
  .search_form .box-footer{text-align:center;}
  .search_form .box-footer button{width:200px;}
  .font-info{margin-left:450px;}
</style>
<div class="box">
  <div class="box-header">
    <h3 class="box-title">已完成任务列表</h3>
  </div>
  <!-- /.box-header -->
  <div class="box-body">
    <!-- <button type="button" class="btn btn-primary search_btn">搜索</button> -->
    <table id="example1" class="table table-bordered table-striped">
      <thead>
      <tr>
        <th>转接人</th>
        <th>承接人</th>
        <th>生成时间</th>
        <th>完成时间</th>
        <th>操作</th>
      </tr>
      </thead>
      <tbody>
      <?php foreach ($model as $val) :?>
      <tr>
        <td><?= $employee[$val->transfer]?></td>
        <td><?= $employee[$val->undertake]?></td>
        <td><?= date('Y-m-d', $val->created_at)?></td>
        <td><?= date('Y-m-d', $val->updated_at)?></td>
        <td><a href="<?= Url::toRoute(['task/viewtask', 'id' => $val->id])?>"><button class="btn btn-primary">查看任务</button></a></td>
      </tr>
      <?php endforeach;?>
      </tbody>
    </table>
  </div>

  <!-- /.box-body -->
  <?= LinkPager::widget(['pagination' => $pages]); ?>
</div>

<div class="search_box">
  <div class="zhezhao"></div>
  <div class="search_form">

  </div>
</div>

<script type="text/javascript" src="js/jquery.js"></script>
<!-- date-range-picker -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.11.2/moment.min.js"></script>
<script src="plugins/daterangepicker/daterangepicker.js"></script>
<script>
    $(".search_btn").click(function(){
      $(".search_box").show();
    });
    $(".search_box .zhezhao").click(function(){
      $(this).parent(".search_box").hide();
    });
    $(".btn-close").click(function(){
      $(".search_box").hide();
    });
    $('#reservation').daterangepicker();
    //Date range picker with time picker
    $('#reservationtime').daterangepicker({timePicker: true, timePickerIncrement: 30, format: 'MM/DD/YYYY h:mm A'});
    //Date range as a button
    $('#daterange-btn').daterangepicker(
        {
          ranges: {
            'Today': [moment(), moment()],
            'Yesterday': [moment().subtract(1, 'days'), moment().subtract(1, 'days')],
            'Last 7 Days': [moment().subtract(6, 'days'), moment()],
            'Last 30 Days': [moment().subtract(29, 'days'), moment()],
            'This Month': [moment().startOf('month'), moment().endOf('month')],
            'Last Month': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month')]
          }
        },
        function (start, end) {
          $('#daterange-btn span').html(start.format('MMMM D, YYYY') + ' - ' + end.format('MMMM D, YYYY'));
        }
    );
</script>